package  
{
	import net.flashpunk.Entity;
	import net.flashpunk.FP;
	import net.flashpunk.utils.Input;
	import net.flashpunk.utils.Key;
	import net.flashpunk.graphics.Spritemap;

	
	/**
	 * ...
	 * @author Donatello
	 */
	public class Player extends Entity
	{
		protected var power:Number=0.2;
		protected var jumpPower:Number=10.0;
		protected var hFriction:Number=0.95;
		protected var vFriction:Number=0.99;
		protected var xSpeed:Number=0;
		protected var ySpeed:Number=0;
		protected var gravity:Number = 0.3; 
		protected var flipped:Boolean = false;
		public var state:String;
		public var playerAnim:Spritemap;
		
	
		
		public function Player(px:Number = 305, py:Number = 500)
		{						
			x = px;
			y = py;
			type = "Player";
		}
		
		override public function update():void {
			
		}
		
		protected function adjustXPosition():void {
			for (var i:int = 0; i < Math.abs(xSpeed); i++) {
				
				if(!collide("Wall",x+FP.sign(xSpeed),y)) {
					x+=FP.sign(xSpeed);
				} else {
					xSpeed=0;
					break;
				}
			}
		}
		protected function adjustYPosition():void {
			for (var i:int=0; i<Math.abs(ySpeed); i++) {
				if (! collide("Wall",x,y+FP.sign(ySpeed))) {
					y+=FP.sign(ySpeed);
				} else {
					ySpeed=0;
					break;
				}
			}
		}
		
		
		public function cambiarEstado(s:String):void{
			state = s;
		}
	
		public function actualizar():void
		{
			
				
		}
	}
}